Add menubar cost/tokens toggle#307
Conversation
|
Superseded by the later visual validation comment after the token-total fix. This earlier comment only proved the data/build path:
That was not enough as visual/product proof. The later validation comment replaces it with screenshots and explains the important fix: Tokens mode now uses standard CodeBurn semantics ( |
bc396f5 to
c078641
Compare
|
Visual validation for #307 after the latest rebase and token-total fix. Update after contributor review: the earlier screenshot showed inflated token totals because Tokens mode was including cache read/write buckets. That screenshot has been replaced. Follow-up fix pushed in
Validation/proof:
Swift unit tests were not used for the final proof because the current local Swift test target is blocked before filtered tests run by the existing unrelated |
85a32fd to
4a135de
Compare
4a135de to
55ab942
Compare


Summary
Fixes #305 by adding a persisted Cost/Tokens toggle to the macOS menubar without changing the existing cost-first workflow.
The important behavior after the latest rebase: Tokens mode now uses CodeBurn's standard token total (
inputTokens + outputTokens) for the status item, hero number, chart bars, and Activity rows. Cache read/write token fields are still carried in the payload for cache metadata and future views, but they are not counted in the visible token total. That prevents inflated numbers such as hundreds of millions of cache-read tokens being shown as today's usage.What changed
Cost | Tokensheadline metric in the macOS menubar app.menubar-jsonwith input/output/cache read/cache write fields for current period, Activity rows, daily history, and model history.0.Example
If today's raw provider data contains:
Tokens mode displays
5.9M tok, matching the standard CodeBurn visible token total, not505M+ tokfrom cache-read traffic.Validation
npx vitest run tests/menubar-json.test.ts tests/day-aggregator.test.ts tests/cli-status-menubar.test.ts tests/daily-cache.test.ts— 43/43 passed.npx tsc --noEmit --pretty false— passed.npm run build— passed.swift buildfrommac/— passed.git diff --check— passed.check,semgrep, andassess— passed.Notes
No screenshots or raw local usage output are included here. Visual validation was done locally, but project names, prompts, paths, session IDs, exact private usage history, and private product details are intentionally omitted.